<li id="micropost-<%= micropost.id %>">
<%= link_to gravatar_for(micropost.user, size: 50), micropost.user %>
<span class="user"><%= link_to micropost.user.name, micropost.user %></span>
<span class="content"><%= markdown(micropost.content) %>
<%= image_tag micropost.picture.url if micropost.picture? %>
</span>
<span class="timestamp">
Posted <%= time_ago_in_words(micropost.created_at) %> ago.
<% if current_user?(micropost.user) %>
<%= link_to "edit", edit_user_micropost_path(micropost.user,micropost) %>
<%= link_to "delete", micropost, method: :delete,data: { confirm: "You sure?" } %>
<% else %>
<%= link_to "comment", new_micropost_comment_path(micropost) %>
<% end %>
</span>

<% if  micropost.comments.any? %>
<h2 style="text-align: left;margin-bottom: 0px ">评论</h2>
<% micropost.comments.each do |comment| %>
  <p style="text-align: left;margin-bottom: 0px ">
    <strong>Content:</strong>
    <%= comment.content %>
    <% if current_user?(comment.user) %>
<%= link_to "delete", comment, method: :delete,data: { confirm: "You sure?" } %>
   <% end %>
  </p>
<% end %>
<% end %>
</li>